local spinning_wheel_table_functions = simplecrafting_lib.generate_table_functions('spinning_wheel', {
   show_guides = true,
   alphabetize_items = true,}
)

local spinning_wheel_table_def = {
   description = 'Spinning Wheel',
   drawtype = 'mesh',
   mesh = 'stations_spinning_wheel.obj',
   tiles = {'stations_spinning_wheel.png'},
   sounds = default.node_sound_wood_defaults(),
   paramtype2 = 'facedir',
   paramtype = 'light',
   selection_box = {
      type = 'fixed',
      fixed = {-.5, -.5, -.25, .5, .2, .25},
      },
   collision_box = {
      type = 'fixed',
      fixed = {-.5, -.5, -.25, .5, .2, .25},
      },
   groups = {oddly_breakable_by_hand = 1, choppy=3},
   after_place_node = function(pos)
      local meta = minetest.get_meta(pos)
      meta:set_string('infotext', 'Spinning Wheel')
   end,
}
for k, v in pairs(spinning_wheel_table_functions) do
   spinning_wheel_table_def[k] = v
end

minetest.register_node('stations:spinning_wheel', spinning_wheel_table_def)


local spinning_wheel_locked_functions = simplecrafting_lib.generate_table_functions('spinning_wheel', {
   show_guides = true,
   alphabetize_items = true,}
)

local spinning_wheel_locked_def = {
   description = 'Spinning Wheel (locked)',
   drawtype = 'mesh',
   mesh = 'stations_spinning_wheel.obj',
   tiles = {'stations_spinning_wheel.png'},
   sounds = default.node_sound_wood_defaults(),
   paramtype2 = 'facedir',
   paramtype = 'light',
   selection_box = {
      type = 'fixed',
      fixed = {-.5, -.5, -.25, .5, .2, .25},
      },
   collision_box = {
      type = 'fixed',
      fixed = {-.5, -.5, -.25, .5, .2, .25},
      },
   groups = {oddly_breakable_by_hand = 1, choppy=3},
   after_place_node = function(pos)
      local meta = minetest.get_meta(pos)
      meta:set_string('infotext', 'Spinning Wheel (Locked)')
   end,
}
for k, v in pairs(spinning_wheel_locked_functions) do
   spinning_wheel_locked_def[k] = v
end

minetest.register_node('stations:spinning_wheel_locked', spinning_wheel_locked_def)

local is_uninv = minetest.global_exists("unified_inventory") or false
if is_uninv then
   unified_inventory.register_craft_type("spinning_wheel", {
      description = "Spinning Wheel",
      icon = 'stations_spinning_icon.png',
      width = 4,
      height = 2,
      uses_crafting_grid = false
   })
end
